package kosta.model.board.dis;

import java.util.List;

import javax.annotation.Resource;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.stereotype.Repository;
@Repository
public class DisBoardDaoImpl implements DisBoardDao{
	@Resource(name="sqlSessionTemplate")
	private SqlSessionTemplate sqlSessionTemplate;

	public DisBoardVO disView() throws Exception {
		return this.sqlSessionTemplate.selectOne("disboard.disView");
	}

	public DisBoardVO selectByDisNo(String no) throws Exception {
		return this.sqlSessionTemplate.selectOne("disboard.selectByDisNo",no);
	}

	public void insertDisBoard(DisBoardVO dvo) throws Exception {
		this.sqlSessionTemplate.insert("disboard.insertDisBoard",dvo);
	}

	public void updateDisBoard(DisBoardVO vo) throws Exception {
		this.sqlSessionTemplate.update("disboard.updateDisBoard",vo);
	}

	public void deleteDisBoard(String disNo) throws Exception {
		this.sqlSessionTemplate.delete("disboard.deleteDisBoard",disNo);
	}

	public List<DisBoardVO> getDisList() throws Exception {
		return this.sqlSessionTemplate.selectList("disboard.getDisList");
	}

	public List<DisBoardVO> findDisContent(String disContent) throws Exception {
		return this.sqlSessionTemplate.selectList("disboard.findDisContent",disContent);
	}
}
